package com.nova.bluetooth.widget.span;

import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

public class MyClickableSpan extends ClickableSpan {
    public interface OnClick {
        void onClick(String tag);
    }

    private OnClick onClick;

    public void setTag(String tag) {
        this.tag = tag;
    }

    private String tag;

    public MyClickableSpan(String tag, OnClick onClick) {
        this.tag = tag;
        this.onClick = onClick;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        ds.setUnderlineText(false);
    }

    @Override
    public void onClick(View widget) {
        onClick.onClick(tag);
    }
}

